#include "Init.h"
#include "AboutDialog.h"
#include <wx/aboutdlg.h>
#include <wx/utils.h>

CAboutDialog::CAboutDialog( wxWindow* parent )
    :
    AboutDialog( parent )
{
    wxAboutDialogInfo aboutInfo;
    aboutInfo.SetName(wxT("ShareMobile Client"));
    aboutInfo.SetVersion(wxT("1.0"));
    wxString about;
    about += wxT("Using ");
    about += wxVERSION_STRING;
    about += wxT(" and ");
    wxString cVersion = wxString::FromAscii(curl_version());
    about += cVersion;
    about += wxT("\nRunning on ");
    about += wxGetOsDescription();

    wxString platform = (wxIsPlatform64Bit()) ? wxT("X64") : wxT("X86");
    wxString appPlatform = (sizeof (void*) == 8) ? wxT("X64") : wxT("X86");
    about += wxT("\nApplication compiled as ");
    about += appPlatform;
    about += wxT(" running on ");
    about += platform;
    about += wxT(" OS");

    wxMemorySize fm = wxGetFreeMemory();

    wxString s;
    s.Printf(wxT("%d bytes"), sizeof (wxMemorySize));
    wxMessageBox (s);

    if (fm != -1)
    {
        about += wxT("\nAvailable memory: ");
        fm /= 1024;
        about += fm.ToString();
        about += wxT(" KB");
    }


    aboutInfo.SetDescription(about);
    aboutInfo.SetCopyright(wxT("(C) 2011-2013 modoran.george@gmail.com"));
    aboutInfo.SetWebSite(wxT("http://www.sharemobile.ro/"));
    //aboutInfo.AddDeveloper("My Self");

    wxAboutBox(aboutInfo);

}
